Start with the functions that are mandatory, your high level shall statements. For example, "The App shall accept coordinates from the LeapJS API." Then decompose that into specific functions you are interested in, like "The App shall store to memory x and y coordinates to calculate the endpoints of a line." Personally, I like to start with the high level requirements, then write user stories. From the user stories I begin to derive the requirements that trace up to the driving requirements. A user story goes something like this: "As a user, I want to draw a straight line using the Leap Motion Controller." That user story is what we call an epic because it actually comprises many stories, like "As a user, I want the Web App to detect the location of my finger as it passes over the Leap Motion Controller." You keep going until you have described enough functionality that the requirements are just a matter of translating the user stories or story points into shall statements. Take a look at this link if you need inspiration: http://dilbert.com/strips/comic/2006-01-29/