Refactored the code,removed all write operations, cleaned it up a LOTT