adapted to new code written on website