Added computer logic functionality and cleaned up code