tested and removed all cout statements