manually merging my code to aliwi's code