Works apart from null pointer exception