Finally working, still testing to do