Finished part-I and conversion to coffeescript