final version. Implemented GET params