Cleaner code, new time (by aki--aki)