small changes to rahul's code