Revision of Routine, refactor the code. The previous version sucks.