final implementation
finally got it working
done
finished final version. now adding polish