added performace code and notes from review