last step and small fix to the final code