new server implementation, works much better