code formatted
resize implemented