change more syntax to coffeescript
remove logging of openlist
refactoring closer to final implementation