working server, need to clean and develop optimized version