implemented end
work in progress
only tested in chrome so far