converted #12 over from javascript and committing it