code is almost done