added in event machine. still need to refactor and fix this up properly
refactor of peer class