added coffescript implementation - 3 lines and 65 chars less