finished up code