added >> and <<; created test functions