Fixed code to run and pass tests