Changed method to work with parameters