more work
fixed some errors
implemented everything before obstacles