to improve previous codes