added Brandon's code