class Flattener {
    companion object {
        fun flatten(inpList: List<Any?>): List<Any?> {
            val returnList: MutableList<Any?> = mutableListOf()
            for (i in inpList){
                if (i is List<*>){
                    returnList.addAll(flatten(i))
                }
                else returnList.add(i)
            }
            return returnList.filter { it != null }
        }
    }
}