Finally the 1st version completed. it's really ugly
fixed a small bug