first shot. Way too much code copied from connect