added cookie security and cleaned up a little