magic numbers everywhere but it works