added random functions, protocol improvements / implementations; random file added to makefile