first working version with everything in query params