added code to methods
answered question