Cleaned up the code to achieve a very basic form of the desired effect.