Replaced temporary functions. Added sending "OK" messages.