calculating everything cleaner