Addressed Senethic's error, many bug fix