communication code done. still need to test, link to front end