cleanup, fixed bug when trying to reset code and added an example