Added helper functions. Split the point and state to their own files.