Added WS functionality to modular code - still need WS to be fixed