code from lcanas added