defined a lot of functions, but somehow this doesn't work as I intended.....