FIXED: made code a bit simpler