added list function to code working stable