Added prints and warnings for errors
Added comments