bug fixing and corrections after feedback