Fixed all bugs in 7, final code