Code cleanup & Re-Write. Removed unneeded items