Initial Port to coffee/js - messy thing though