Code cleanup. Path finding added.