Added cliff feature.

Also refactored the code into groups.