Just a rough working version :S