6th. fixed some basic bugs