fixed background detection & added border t/l/b/r along with corners for
curves. Havem't programed them yet