Fixing several mistakes
added brief testing stuff