cleaned up loooking for memeory error