Putting some final touches on the code