started working on factorial function for JS