Fixed #1 resolves #2 fixes #3 resolves #4 fixes #5