Cleaning up code and fixing message count

Signed-off-by: Chris Conley <chrisc93@vt.edu>